/**
 * 外部模块 用 module
 * 内部模块 用 namespace 
 */


namespace Functions{
  export var add: (a: number, b: number) => number;
  export var log: (msg: string) => void;

  add = function(a: number, b: number) {
    return a + b;
  };

  export interface IHttpOptions {
    url: number;
    method: string;
    callback: (data: any) => void;
  }

  export function ajaxCall(options: IHttpOptions) {
    //make an XHR call here
  }
}

let option:Functions.IHttpOptions = {
  url:12,
  method:'post',
  callback:()=>{}
}
Functions.add(5,6)
Functions.ajaxCall(option)